home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / Gnuplot / Source / term / regis.trm < prev    next >
Encoding:
Text File  |  1993-03-02  |  3.0 KB  |  147 lines

  1. /*
  2.  * $Id: regis.trm 3.38.2.42 1993/01/07 17:23:59 woo Exp woo $
  3.  *
  4.  */
  5.  
  6. /* GNUPLOT - regis.trm */
  7. /*
  8.  * Copyright (C) 1990 - 1993   
  9.  *
  10.  * Permission to use, copy, and distribute this software and its
  11.  * documentation for any purpose with or without fee is hereby granted, 
  12.  * provided that the above copyright notice appear in all copies and 
  13.  * that both that copyright notice and this permission notice appear 
  14.  * in supporting documentation.
  15.  *
  16.  * Permission to modify the software is granted, but not the right to
  17.  * distribute the modified code.  Modifications are to be distributed 
  18.  * as patches to released version.
  19.  *  
  20.  * This software  is provided "as is" without express or implied warranty.
  21.  * 
  22.  * This file is included by ../term.c.
  23.  *
  24.  * This terminal driver supports:
  25.  *  REGIS devices
  26.  *
  27.  * AUTHORS
  28.  *  Colin Kelley, Thomas Williams
  29.  * 
  30.  * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  31.  * 
  32.  */
  33.  
  34. #define REGISXMAX 800             
  35. #define REGISYMAX 440
  36.  
  37. #define REGISXLAST (REGISXMAX - 1)
  38. #define REGISYLAST (REGISYMAX - 1)
  39.  
  40. #define REGISVCHAR        20      
  41. #define REGISHCHAR        9
  42. #define REGISVTIC        8
  43. #define REGISHTIC        6
  44.  
  45. int REGISang = 0;
  46.  
  47. REGISinit()
  48. {
  49.     fprintf(outfile,"\033[r\033[24;1H");
  50. /*                   1     2
  51.     1. reset scrolling region
  52.     2. locate cursor on bottom line
  53. */
  54. }
  55.  
  56.  
  57. /* thanks to calmasd!dko (Dan O'Neill) for adding S(E) for vt125s */
  58. REGISgraphics()
  59. {
  60.     fprintf(outfile,"\033[2J\033P1pS(C0)S(E)");
  61. /*                   1      2      3    4   5
  62.     1. clear screen
  63.     2. enter ReGIS graphics
  64.     3. turn off graphics diamond cursor
  65.     4. clear graphics screen
  66. */
  67.     (void) REGIStext_angle(0); /* select text size and angle */ 
  68. }
  69.  
  70.  
  71. REGIStext()
  72. {
  73.     fprintf(outfile,"\033\\\033[24;1H");
  74. /*                       1    2
  75.     1. Leave ReGIS graphics mode
  76.      2. locate cursor on last line of screen
  77. */
  78. }
  79.  
  80.  
  81. REGISlinetype(linetype)
  82. int     linetype;
  83. {
  84.       /* This will change color in order G,R,B,G-dot,R-dot,B-dot */
  85. static int in_map[9 + 2] = {2, 2, 3, 2, 1, 3, 2, 1, 3, 2, 1};
  86. static int lt_map[9 + 2] = {1, 4, 1, 1, 1, 4, 4, 4, 6, 6, 6};
  87.  
  88.     if (linetype >= 9)
  89.         linetype %= 9;
  90.     fprintf(outfile, "W(I%d)", in_map[linetype + 2]);
  91.     fprintf(outfile, "W(P%d)", lt_map[linetype + 2]);
  92. }
  93.  
  94.  
  95. REGISmove(x,y)
  96. int x,y;
  97. {
  98.     fprintf(outfile,"P[%d,%d]",x,REGISYLAST-y,x,REGISYLAST-y);
  99. }
  100.  
  101.  
  102. REGISvector(x,y)
  103. int x,y;
  104. {
  105.     fprintf(outfile,"v[]v[%d,%d]",x,REGISYLAST - y);
  106. /* the initial v[] is needed to get the first pixel plotted */
  107. }
  108.  
  109.  
  110. /* put_text and text_angle by rjl */
  111. REGISput_text(x,y,str)
  112. int x, y;
  113. char *str;
  114. {
  115.     if (REGISang==1)
  116.         REGISmove(x-REGISVCHAR/2-1,y);
  117.     else
  118.         REGISmove(x,y+REGISVCHAR/2-1);
  119.     (void) putc('T',outfile); (void) putc('\'',outfile);
  120.     while (*str) {
  121.         (void) putc(*str,outfile);
  122.         if (*str == '\'')
  123.             (void) putc('\'',outfile);    /* send out another one */
  124.         str++;
  125.     }
  126.     (void) putc('\'',outfile);
  127. }
  128.  
  129.  
  130. int REGIStext_angle(ang)
  131. int ang;
  132. {
  133.     REGISang = ang;
  134.     if (ang == 1)
  135.         fputs("T(D90,S1)",outfile);
  136.     else
  137.         fputs("T(D0,S1)",outfile);
  138.     return TRUE;
  139. }
  140.  
  141.  
  142. REGISreset()
  143. {
  144.     fprintf(outfile,"\033[2J\033[24;1H");
  145. }
  146.  
  147.